[]
dashboard.VisualNS.FilterService
• new FilterService()
▸ applyFilter(filter
): any
此方法用于调用筛选器。
名称 | 类型 |
---|---|
filter |
BasicFilter | TupleFilter | AdvancedFilter |
any
示例代码
dom.addEventListener('click', (e) => {
const it = e.target as HTMLLIElement;
if (it.hasAttribute('data-value')) {
const val = it.dataset.value;
if (this.filter.contains(val)) {
this.filter.remove(val);
} else {
this.filter.add(val);
}
host.filterService.applyFilter(this.filter);
} else if (it.getAttribute('data-role') === 'toggle') {
this.filter.setOperator(this.filter.getOperator() === Enums.BasicFilterOperator.In ? Enums.BasicFilterOperator.NotIn :Enums.BasicFilterOperator.In);
host.filterService.applyFilter(this.filter);
}
})
▸ clean(): any
清除所有筛选器
any